home *** CD-ROM | disk | FTP | other *** search
/ One Click 21 (Special) / OC021.iso / Juegos / King of Skeleton / King of Skeleton.swf / scripts / __Packages / WarningArray.as < prev    next >
Encoding:
Text File  |  2006-02-02  |  1.2 KB  |  66 lines

  1. class WarningArray extends Array
  2. {
  3.    var warning;
  4.    function WarningArray()
  5.    {
  6.       super();
  7.       if(arguments.length > 1)
  8.       {
  9.          this.splice.apply(this,[0,0].concat(arguments));
  10.       }
  11.       else if(arguments.length == 0)
  12.       {
  13.          var _loc4_ = 0;
  14.          while(_loc4_ < arguments[0])
  15.          {
  16.             this[_loc4_] = undefined;
  17.             _loc4_ = _loc4_ + 1;
  18.          }
  19.       }
  20.    }
  21.    function checkWarning(d)
  22.    {
  23.       if(this.length > 0)
  24.       {
  25.          var _loc2_ = 0;
  26.          while(d < this[_loc2_].d)
  27.          {
  28.             _loc2_ = _loc2_ + 1;
  29.          }
  30.          if(_loc2_ < this.length)
  31.          {
  32.             this.warning.gotoAndPlay(this.shift().t);
  33.          }
  34.       }
  35.    }
  36.    function copy()
  37.    {
  38.       var _loc2_ = new WarningArray();
  39.       for(var _loc3_ in this)
  40.       {
  41.          _loc2_[_loc3_] = this[_loc3_];
  42.       }
  43.       return _loc2_;
  44.    }
  45.    function warningSort()
  46.    {
  47.       this.sort(WarningArray.distSort);
  48.    }
  49.    function toString()
  50.    {
  51.       return this.join(",\n");
  52.    }
  53.    static function distSort(a, b)
  54.    {
  55.       if(a.d > b.d)
  56.       {
  57.          return 1;
  58.       }
  59.       if(a.d < b.d)
  60.       {
  61.          return -1;
  62.       }
  63.       return 0;
  64.    }
  65. }
  66.